package com.tianhui.consignortwofei.mvp.model;

import android.content.Context;

import com.fgs.common.CommonModel;
import com.fgs.common.api.CommonConfig;
import com.fgs.common.progress.ObserverResponseListener;
import com.tianhui.consignortwofei.api.ConsignorApiService;
import com.tianhui.consignortwofei.mvp.model.enty.ConsignorInfo;

import java.util.List;
import java.util.Map;

import io.reactivex.ObservableTransformer;
import okhttp3.MultipartBody;

/**
 * @author fgs
 * @date 2020/3/30
 * @description
 **/
public class AuthenticationModel<T> extends CommonModel implements IPictureModel<T> {


    /**
     * 货主认证
     *
     * @param context
     * @param authInfo
     * @param isDialog
     * @param transformer
     * @param observerListener
     */
    public void consignorAuthModel(Context context, ConsignorInfo authInfo, boolean isDialog,
                                   ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {

        subscribe(context, CommonConfig.getInstance().create(ConsignorApiService.class).consignorAuthentication(authInfo), observerListener, transformer, isDialog, true);
    }


    /**
     * 认证司机信息
     *
     * @param context
     * @param map
     * @param isDialog
     * @param cancelable
     * @param transformer
     * @param observerListener
     */
    public void consignorInfoModel(Context context, Map<String, String> map, boolean isDialog, boolean cancelable,
                                   ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {

        subscribe(context, CommonConfig.getInstance().create(ConsignorApiService.class).consignorInfo(), observerListener, transformer, isDialog, cancelable);
    }


//    /**
//     * 行驶证识别
//     *
//     * @param context
//     * @param map
//     * @param isDialog
//     * @param transformer
//     * @param observerListener
//     */
//    public void driverLicenseOcrModel(Context context, Map<String, String> map, boolean isDialog,
//                                      ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {
//
//        subscribe(context, CommonConfig.getInstance().create(ApiService.class).driverLicenseOcr(map), observerListener, transformer, isDialog, true);
//    }


    @Override
    public void uploadPictureModel(Context context, List<MultipartBody.Part> parts, boolean isDialog, ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {
//        subscribe(context, CommonConfig.getInstance().create(ApiService.class).uploadPicture(parts), observerListener, transformer, isDialog, true);
    }
}